package org.example.springioc.controller;

import jakarta.annotation.Resource;
import org.example.springioc.Service.UserService;
import org.example.springioc.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
//    @Qualifier("userInfo1")
    @Autowired
    //1.根据名称和类型去查
    //2.如果根据名称查不到就根据类型去查
    //@Resource(name="UCInfo")
    private UserInfo user;
    //private UserService user;

    /*@Autowired
    public UserController(UserInfo userInfo) {
        this.userInfo = userInfo;
    }*/

    public void sayHi(){
        System.out.println(user);
        System.out.println("hi,user controller");
    }

}
